using System;
using System.Collections.Generic;

namespace TouchSmart
{
    public static class Locator
    {
        private static readonly Dictionary<Type, object> _services = new Dictionary<Type, object>();

        public static void Register<T>(T service)
        {
            _services.Add(typeof(T), service);
        }

        public static T GetService<T>()
        {
            return (T)_services[typeof (T)];
        }
    }
}